-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default trait implementations for "c-unwind" ABI function pointers #101263
Add default trait implementations for "c-unwind" ABI function pointers #101263
Conversation
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
it looks like I need to bless changes to the UI tests. Let me try and figure out how to do that 😄 Edit: done! |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2f7cc2d574b203e1f19b63ee705fe217fefc31ee with merge c97600b8b2ec5ef84e1426b75f8be57bf5450712... |
☀️ Try build successful - checks-actions |
Queued c97600b8b2ec5ef84e1426b75f8be57bf5450712 with parent aa857eb, future comparison URL. |
Finished benchmarking commit (c97600b8b2ec5ef84e1426b75f8be57bf5450712): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Yeah, as expected that extra metadata in the rlib makes everything measurably slower. Not sure if there is a way that we can avoid some of these instances (do we really need all the traits here), but in the end it boils down to judging whether that's a cost we are willing to accept for the benefit of #74990. Sounds like a @rust-lang/compiler question to me. |
Discussed in T-compiler triage meeting. I think we should move forward with this, despite the performance hit. I don't want to block c-unwind based on the performance regression observed above. (If it turns out that the performance impact matters, then we can adopt other approaches, such as the one suggested in #99531; though I'm hoping that will not be necessary solely for this issue.) @rustbot label: -I-compiler-nominated |
(also, as a side note: the primary benchmarks only regressed on "doc full" scenarios. Normal compilation (check/debug/opt) all came out looking great I would say.) @rustbot label: +perf-regression-triaged |
@RalfJung Given the above triage on the perf regression from the compiler team, what are the next steps for getting this approved and merged? |
It needs someone from t-libs to review and approve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl looks fine, I think this needs libs-api signoff, or perhaps an ACP.
Following up on #92964, only add default trait implementations for the `c-unwind` family of function pointers. The previous attempt in #92964 added trait implementations for many more ABIs and ran into concerns regarding the increase in size of the libcore rlib. An attempt to abstract away function pointer types behind a unified trait to reduce the duplication of trait impls is being discussed in #99531 but this change looks to be blocked on a lang MCP. Following @RalfJung's suggestion in #99531 (comment), this commit is another cut at #92964 but it _only_ adds the impls for `extern "C-unwind" fn` and `unsafe extern "C-unwind" fn`. I am interested in landing this patch to unblock the stabilization of the `c_unwind` feature. RFC: rust-lang/rfcs#2945 Tracking Issue: #74990
This comment was marked as outdated.
This comment was marked as outdated.
I couldn't figure out the right combination of |
Looks like the build still fails with |
This comment has been minimized.
This comment has been minimized.
Oh. :( Yeah. I suppose you could apply |
These need to wait until #103239 makes it into the bootstrap compiler.
LGTM, thanks. @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5c8bff7): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
It's all doc perf regressions, and was decided earlier to be acceptable. @rustbot label: +perf-regression-triaged |
Following up on #92964, only add default trait implementations for the
c-unwind
family of function pointers. The previous attempt in #92964 added trait implementations for many more ABIs and ran into concerns regarding the increase in size of the libcore rlib.An attempt to abstract away function pointer types behind a unified trait to reduce the duplication of trait impls is being discussed in #99531 but this change looks to be blocked on a lang MCP.
Following @RalfJung's suggestion in #99531 (comment), this commit is another cut at #92964 but it only adds the impls for
extern "C-unwind" fn
andunsafe extern "C-unwind" fn
.I am interested in landing this patch to unblock the stabilization of the
c_unwind
feature.RFC: rust-lang/rfcs#2945
Tracking Issue: #74990